import {localeProps} from '../../utils';

const label = '提示';
const name = 'jd-alert';

export default {
    icon: 'icon-alert',
    label,
    name,
    mask: false,
    rule({t}) {
        return {
            type: 'el-alert',
            props: {
                title: '标题',
                description: '提示内容',
                type: 'info',
                effect: 'dark',
                closable: false,
                showIcon: true,
            },
            children: []
        };
    },
    props(_, {t}) {
        return localeProps(t, name + '.props', [{type: 'input', field: 'title', title: '标题'}, {
            type: 'select',
            field: 'type',
            title: '类型',
            options: [{label: '成功 Success', value: 'success'}, {label: '警告 Warning', value: 'warning'}, {
                label: '一般 Info',
                value: 'info'
            }, {label: '错误 Error', value: 'error'}]
        }, {type: 'input', field: 'description', title: '内容'}, {
            type: 'switch',
            field: 'closable',
            title: '允许关闭',
            value: false
        }, 
        {type: 'switch', field: 'center', title: '文字居中', value: false},
        {type: 'switch', field: 'showIcon', title: '显示图标'}, {
            type: 'select',
            field: 'effect',
            title: '主题',
            options: [{label: '亮色', value: 'light'}, {label: '深色', value: 'dark'}]
        }]);
    }
};
